#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream> // cout
#include <vector>
#include <string>
#include <algorithm> //sort
using namespace std;

int main() {
    int n = 0;
    cin >> n;
    vector<string> vs;
    string s;
    for (int i = 0; i < n; i++) {
        while (cin >> s) {
            vs.push_back(s);
        }
    }
    sort(vs.begin(), vs.end());
    for (auto& e : vs)
    {
        cout << e << " ";
    }
}